#ifndef __NJGIS_NJMODELSERVICERECORD_H__
#define __NJGIS_NJMODELSERVICERECORD_H__

#include "../include/INxModelServiceRecord.h"
#include "NxService.h"
#include "../include/INxRunningLog.h"
#include "NxRunningLogFactory.h"

namespace NJGIS
{
	namespace SERVICE
	{
		class NjModelServiceRecord : public virtual INjModelServiceRecord, public virtual NjService
		{
		public:
			NjModelServiceRecord(){
				this->_list_log = new std::vector<INjRunningLog*> ();
			};

			NjModelServiceRecord(
				const char* oid,
				const char* msid,
				const char* datetime,
				double span,
				const char* guid,
				INjDataConfiguration* input,
				INjDataConfiguration* output,
				NjRecordStatus status,
				const char* cstdout,
				const char* cstderr,
				const char* invkerr,
				const char* ip,
				int port
				):
				_oid(oid),
				_msid(msid),
				_datetime(datetime),
				_span(span),
				_guid(guid),
				_input(input),
				_output(output),
				_status(status),
				_stdout(cstdout),
				_stderr(cstderr),
				_invkerr(invkerr),
				NjService(ip, port)
				{
					this->_list_log = new std::vector<INjRunningLog*> ();
				};
				~NjModelServiceRecord()
				{
					delete this->_list_log;
				}

			virtual const char* getID();

			virtual const char* getModelServiceID();

			virtual const char* getStartDatetime();

			virtual int getTimeSpan();

			virtual INjDataConfiguration* getInputData();

			virtual INjDataConfiguration* getOutputData();

			virtual NjRecordStatus getStatus();

			virtual const char* getRunningInfo_Standout();

			virtual const char* getRunningInfo_Standerr();

			virtual const char* getRunningInfo_Invokeerr();

			virtual std::vector<INjRunningLog*>* getLogs();

			virtual int refresh();

			virtual void wait4Finished();

			virtual const char* getGUID();

		private:
			std::string _oid;

			std::string _msid;

			std::string _datetime;

			double _span;

			std::string _guid;

			INjDataConfiguration* _input;

			INjDataConfiguration* _output;

			NjRecordStatus _status;

			std::string _stdout;

			std::string _stderr;

			std::string _invkerr;

			std::vector<INjRunningLog*>* _list_log;

		};
	}
}

#endif